<template>
	<view :class="[BackGround]" :style="[{'font-weight':Style,'font-family':Font,height:100 + '%',minHeight:screenHeight + 'px'}]">
		<cu-custom bgColor="bg-gradual-blue" isBack="true">
			<view slot="backText">返回</view>
			<view slot="content">细纱实时数据详情</view>
		</cu-custom>
		<view class="fixedtwo" :style="{top:CustomBar + 'rpx'}">
			<image style="width: 50%;height: 400rpx;" mode="scaleToFill" src="/static/images/timedataFingdetail.jpg"></image>
			<view class="" style="background-color: whitesmoke;width: 54%;">
				<view style="padding: 10rpx;">基础信息</view>
				<view class="" style="height: 50rpx;line-height: 50rpx;">
					<text class="cuIcon-title text-orange "></text> 机器型号:山西经纬 JW9500
				</view>
				<!-- <view class="" style="height: 50rpx;line-height: 50rpx;">
					<text class="cuIcon-title text-orange "></text> 运行状态:{{tableList['powerStatus'] == 1 ? '开车' : '停车'}}
				</view> -->
				<!-- <view class="" style="height: 50rpx;line-height: 50rpx;">
					<text class="cuIcon-title text-orange "></text> 总产量:{{tableList['cumulativeOutput']}}
				</view> -->
				<!-- <view class="" style="height: 50rpx;line-height: 50rpx;">
					<text class="cuIcon-title text-orange "></text> 当前班:{{tableList['currentClass']}}
				</view> -->
				<view class="" style="height: 50rpx;line-height: 50rpx;">
					<text class="cuIcon-title text-orange "></text> 剩余时间:00时00分00秒
				</view>
				<!-- <view class="" style="height: 50rpx;line-height: 50rpx;">
					<text class="cuIcon-title text-orange "></text> 捻度:{{tableList['twistMeasure']}}
				</view>
				<view class="" style="height: 50rpx;line-height: 50rpx;">
					<text class="cuIcon-title text-orange "></text> 当前锭速:{{tableList['currentSpindleSpeed']}}
				</view>
				<view class="" style="height: 50rpx;line-height: 50rpx;">
					<text class="cuIcon-title text-orange "></text> 总产量:{{tableList['总产量']}} 
				</view> -->
			</view>
		</view>
		<!-- 机器状态 -->
		<view v-if="page == 0" :key="page">
			<text>25616516</text>
			<navTab ref="navTab" :number="2" :tabTitle="tabTitle" @changeTab='changeTab'></navTab>
			<swiper :current="currentTab" @change="swiperTab" class="swiper" :style="{top:CustomBar + 500 + 'rpx',height:height + 'px'}">
				<swiper-item v-for="(listItem,index) in 2" :key="index">
					<scroll-view style="height: 100%;" scroll-y scroll-with-animation>
						<!-- 数据列表组件 -->
						<scroll-view style="height: 100%;" scroll-y scroll-with-animation>
							<view v-if="index == 0">
								<view class="cu-form-group">
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178);">
										<view>运行模式</view>
										<view style="text-align:center">自动状态</view>
									</view>
								</view>
								<view class="cu-form-group" >
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>前罗拉速度(r/min)</view>
										<view style="text-align:center">{{tableList['frontRollerSpeed']}}</view>
									</view>
								</view>
								<view class="cu-form-group" >
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>锭子转速(r/min)</view>
										<view style="text-align:center">{{tableList['currentSpindleSpeed']}}</view>
									</view>
								</view>
								<view class="cu-form-group" >
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>钢领板位置(mm)</view>
										<view style="text-align:center">71.0</view>
									</view>
								</view>
								<view class="cu-form-group" >
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>当前管纱长度(m)</view>
										<view style="text-align:center">96</view>
									</view>
								</view>
								<view class="cu-form-group" >
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>当前落管数</view>
										<view style="text-align:center">212</view>
									</view>
								</view>
								<view class="cu-form-group" >
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>紧密纺负压监测(车尾)(Kpa)</view>
										<view style="text-align:center">0.0</view>
									</view>
								</view>
								<view class="cu-form-group" >
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>紧密纺负压监测(车头)(Kpa)</view>
										<view style="text-align:center">0.0</view>
									</view>
								</view>
							</view>
							<view v-else-if="index == 1">
								<view class="cu-bar solid-bottom">
									<view class="action text-green">
										<text class="cuIcon-title text-orange "></text> 主机参数
									</view>
								</view>
								<view class="cu-form-group" style="padding-left: 70rpx;">
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>当前锭子速度(r/min)</view>
										<view style="text-align:center">{{tableList['currentSpindleSpeed']}}</view>
									</view>
								</view>
								<view class="cu-form-group" style="padding-left: 70rpx;">
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>平均锭子速度(r/min)</view>
										<view style="text-align:center">{{tableList['speedSpindleAverage']}}</view>
									</view>
								</view>
								<view class="cu-form-group" style="padding-left: 70rpx;">
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>前罗拉速度(r/min)</view>
										<view style="text-align:center">{{tableList['frontRollerSpeed']}}</view>
									</view>
								</view>
								<view class="cu-form-group" style="padding-left: 70rpx;">
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>当前管纱长度(m)</view>
										<view style="text-align:center">118</view>
									</view>
								</view>
								<view class="cu-form-group" style="padding-left: 70rpx;">
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>当前纺纱长度百分比(%)</view>
										<view style="text-align:center">3</view>
									</view>
								</view>
								<view class="cu-form-group" style="padding-left: 70rpx;">
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>剩余纺纱时间(min)</view>
										<view style="text-align:center">241</view>
									</view>
								</view>
								<view class="cu-form-group" style="padding-left: 70rpx;">
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>细纱号数</view>
										<view style="text-align:center">{{tableList['yarnNum']}}</view>
									</view>
								</view>
								<view class="cu-form-group" style="padding-left: 70rpx;">
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>牵伸倍数(times)</view>
										<view style="text-align:center">{{tableList['draftSet']}}</view>
									</view>
								</view>
								<view class="cu-form-group" style="padding-left: 70rpx;">
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>粗纱锭量</view>
										<view style="text-align:center">{{tableList['rovingSpindleWeightOfOneKilom']}}</view>
									</view>
								</view>
								<view class="cu-form-group" style="padding-left: 70rpx;">
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>捻度</view>
										<view style="text-align:center">{{tableList['twistMeasure']}}</view>
									</view>
								</view>
								<view class="cu-bar solid-bottom margin-top">
									<view class="action text-green">
										<text class="cuIcon-title text-orange "></text> 卷绕参数
									</view>
								</view>
								<view class="cu-form-group" style="padding-left: 70rpx;">
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>A20罗拉速度</view>
										<view style="text-align:center">153</view>
									</view>
								</view>
								<view class="cu-form-group" style="padding-left: 70rpx;">
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>刚领板最高位置</view>
										<view style="text-align:center">92.0</view>
									</view>
								</view>
								<view class="cu-form-group" style="padding-left: 70rpx;">
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>刚领板实时位置</view>
										<view style="text-align:center">59.0</view>
									</view>
								</view>
								<view class="cu-form-group" style="padding-left: 70rpx;">
									<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
										<view>凸轮位置</view>
										<view style="text-align:center">20.0</view>
									</view>
								</view>
							</view>
						</scroll-view>
					</scroll-view>
				</swiper-item>
			</swiper>
		</view>
		<!-- 参数设置 -->
		<view v-if="page == 1">
			<navTab ref="navTab" :number="2" :tabTitle="tabTitle2" @changeTab='changeTab2'></navTab>
			<swiper :current="currentTab2" @change="swiperTab2" class="swiper" :style="{top:CustomBar + 500 + 'rpx',height:height + 'px'}">
				<swiper-item v-for="(listItem,index) in 2" :key="index">
					<scroll-view style="height: 100%;" scroll-y scroll-with-animation>
						<!-- 数据列表组件 -->
						<scroll-view style="height: 100%;" scroll-y scroll-with-animation>
							<view v-if="index == 0">
								<navTabSon ref="navTabSon2" :tabTitleSon="tabTitleSon2" @changeTabSon='changeTabSon2'></navTabSon>
								<swiper :current="currentTabSon2" @change="swiperTabSon2" class="swiper" :style="{top:76 + 'rpx',height:heightSon + 'px'}">
									<swiper-item v-for="(listItem,index6) in 2" :key="index6">
										<scroll-view style="height: 100%;" scroll-y scroll-with-animation>
											<view v-if="index6 == 0">
												<view class="cu-form-group" v-for="(item,index7) in List4" :key="index7">
													<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
														<view> {{item.name}}</view>
														<view style="text-align:center"> {{item.data}}</view>
													</view>
												</view>
											</view>
											<view v-else-if="index6 == 1">
												<view class="cu-form-group" v-for="(item,index8) in List5" :key="index8">
													<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
														<view> {{item.name}}</view>
														<view> {{item.value}}</view>
													</view>
												</view>
											</view>
										</scroll-view>
									</swiper-item>
								</swiper>
							</view>
							<view v-else-if="index == 1">
								<navTabSon ref="navTabSon3" :tabTitleSon="tabTitleSon3" @changeTabSon='changeTabSon3'></navTabSon>
								<swiper :current="currentTabSon3" @change="swiperTabSon3" class="swiper" :style="{top:76 + 'rpx',height:heightSon + 'px'}">
									<swiper-item v-for="(listItem,index) in 1" :key="index">
										<scroll-view style="height: 100%;" scroll-y scroll-with-animation>
											<view v-if="index == 0">
												<view class="cu-form-group" v-for="(item,index10) in List8" :key="index10">
													<view class="grid col-2" style="width: 100%;color:rgb(127, 184, 178)">
														<view> {{item.name}}</view>
														<view style="text-align: center;"> {{item.data}}</view>
													</view>
												</view>
											</view>
										</scroll-view>
									</swiper-item>
								</swiper>
							</view>
						</scroll-view>
					</scroll-view>
				</swiper-item>
			</swiper>
		</view>
		<view v-if="page == 2">
			<navTab ref="navTab" :number='1' :tabTitle="tabTitle3" @changeTab='changeTab3'></navTab>
			<swiper :current="currentTab3" @change="swiperTab3" class="swiper" :style="{top:CustomBar + 500 + 'rpx',height:height + 'px'}">
				<swiper-item v-for="(listItem,index) in 3" :key="index">
					<scroll-view style="height: 100%;" scroll-y scroll-with-animation>
						<!-- 数据列表组件 -->
						<scroll-view style="height: 100%;" scroll-y scroll-with-animation>
							<view v-if="index == 0">
								<navTabSon ref="navTabSon4" :tabTitleSon="tabTitleSon4" @changeTabSon='changeTabSon4'></navTabSon>
								<swiper :current="currentTabSon4" @change="swiperTabSon4" class="swiper" :style="{top:76 + 'rpx',height:heightSon + 'px'}">
									<swiper-item v-for="(listItem,index4) in 4" :key="index4">
										<scroll-view style="height: 100%;" scroll-y scroll-with-animation>
											<view v-if="index4 == 0">
												<view class="cu-form-group" v-for="(item,index12) in List10" :key="index12">
													<view class="grid col-3" style="width: 100%;color:rgb(127, 184, 178)">
														<view> {{item.name}}</view>
														<view> {{item.data}}</view>
														<view> {{item.value}}</view>
													</view>
												</view>
											</view>
										</scroll-view>
									</swiper-item>
								</swiper>
							</view>
						</scroll-view>
					</scroll-view>
				</swiper-item>
			</swiper>
		</view>
		<view v-if="page == 3">
			<navTab ref="navTab" :number="0" :tabTitle="tabTitle4" @changeTab='changeTab4'></navTab>
			<swiper :current="currentTab4" @change="swiperTab4" class="swiper" :style="{top:CustomBar + 500 + 'rpx',height:height + 'px'}">
				<swiper-item v-for="(listItem,index) in 1" :key="index">
					<scroll-view style="height: 100%;" scroll-y scroll-with-animation>
						<!-- 数据列表组件 -->
						<scroll-view style="height: 100%;" scroll-y scroll-with-animation>
							<view v-if="index == 0">
								<!-- <navTabSon ref="navTabSon5" :tabTitleSon="tabTitleSon5" @changeTabSon='changeTabSon5'></navTabSon>
								<swiper :current="currentTabSon5" @change="swiperTabSon5" class="swiper" :style="{top:76 + 'rpx',height:heightSon + 'px'}">
									<swiper-item v-for="(listItem,index5) in 4" :key="index5">
										<scroll-view style="height: 100%;" scroll-y scroll-with-animation>

										</scroll-view>
									</swiper-item>
								</swiper> -->
							</view>
						</scroll-view>
					</scroll-view>
				</swiper-item>
			</swiper>
		</view>
		<tui-fab :btnList="btnList" @click="onClick"></tui-fab>
	</view>
</template>

<script>
	import navTabSon from '@/colorui/components/navTabSon.vue'
	import navTab from '@/colorui/components/navTab.vue'
	import ScrollDome from '@/colorui/components/ScrollDome'
	import tTable from '@/colorui/components/t-table/t-table.vue';
	import tTh from '@/colorui/components/t-table/t-th.vue';
	import tTr from '@/colorui/components/t-table/t-tr.vue';
	import tTd from '@/colorui/components/t-table/t-td.vue';
	import tuiFab from "@/colorui/components/tui-fab/tui-fab"
	import {
		mapGetters
	} from 'vuex'
	import {
		getMinuteInfo
	} from '@/service/selectList'
	import uCharts from '@/colorui/components/u-charts/u-charts.js';
	var canvaColumn = null;
	let Interval = null;
	import {
		ucharts
	} from '@/mixin/mixin.js'
	export default {
		mixins: [ucharts],
		data() {
			return {
				cWidth: '',
				cHeight: '',
				pixelRatio: 1,
				textarea: '',
				tableList: {},
				page: 0,
				name:'',
				CustomBar: this.CustomBar,
				screenHeight: this.screenHeight,
				tabTitle: ['运行状态', '参数显示'], //机器装态导航栏格式
				currentTab: 0, //sweiper所在页
				

				tabTitle2: ['主控参数', '卷绕参数'], //参数设置导航栏格式
				currentTab2: 0, //sweiper所在页
				List4: [{
						name: '滚盘直径(mm)',
						data: "250",
						value: '磨钢丝圈减速比 0 %'
					},
					{
						name: '锭盘直径(mm)',
						data: "19.0",
						value: '磨合时间设定 0 min'
					},
					{
						name: '罗拉直径(mm)',
						data: "27",
						value: ''
					},
					{
						name: '锭速修正',
						data: "0.991",
						value: '磨合功能选择 磨合功能关闭'
					},
					{
						name: '频率调整',
						data: "180",
						value: ''
					},
					{
						name: '锭数设定',
						data: "1200",
						value: ''
					},
					{
						name: '罗拉速度修正',
						data: "1.000",
						value: ''
					},
					{
						name: '落纱模式1定长',
						data: "1",
						value: ''
					},
					{
						name: '定长设置(m)',
						data: "3200",
						value: ''
					},
					{
						name: '定时设置(v)',
						data: "10",
						value: ''
					},
				],
				List5: [{
						name: '基本频率(Hz)',
						data: "",
						value: '50'
					},
					{
						name: '粗纱定量',
						data: "0.00 Ne",
						value: '720'
					},
					{
						name: '主轴皮带盘直径(z)',
						data: "",
						value: '215'
					},
					// {
					// 	name: '主电机皮带盘直径',
					// 	data: "",
					// 	value: '195 z'
					// },
					// {
					// 	name: '滴油运行时间',
					// 	data: "",
					// 	value: '60.0 S'
					// },
					// {
					// 	name: '滴油停顿时间',
					// 	data: "",
					// 	value: '360.0 S'
					// },
					// {
					// 	name: '吹吸风停时间',
					// 	data: "",
					// 	value: '20 min'
					// },
					// {
					// 	name: '吹吸风暂停时间',
					// 	data: "",
					// 	value: '0.0 S'
					// },
					// {
					// 	name: '落纱落管模式选择(=1相关联)',
					// 	data: "",
					// 	value: '1'
					// },
					// {
					// 	name: '落纱吹吸风模式选择(=1相关联)',
					// 	data: "",
					// 	value: '1'
					// },
				],
				List7: [{
						name: '吸棉风机开————主轴开',
						data: "8.0 S"
					},
					{
						name: '吸棉风机开————纲领板动',
						data: "3.0 S"
					},
					{
						name: '吸棉风机开————导纱板落',
						data: "2.0 S"
					},
					{
						name: '启动速度运行时间',
						data: "30.0 S"
					},
					{
						name: '起纱锭速',
						data: "6000 rpm"
					},
					{
						name: '落纱锭速',
						data: "4700 rpm"
					},
					{
						name: '主轴关————起纱时间',
						data: "7.0 S"
					},
					{
						name: '主轴关————主轴刹车',
						data: "1.3 S"
					},
					{
						name: '纲领板降到底————主轴关',
						data: "1.00 "
					},
				],
				List8: [{
						name: '纲领板落纱速度',
						data: "3200"
					},
					{
						name: '落纱留尾头纲领板的速度',
						data: "2400"
					},
					{
						name: '落纱留尾头纲领板的距离',
						data: "0.0 mm"
					},
					{
						name: '纲领板中纱位停顿时间',
						data: "0.50 S"
					},
					{
						name: '始纺升速度',
						data: "900"
					},
					{
						name: '始纺降速度',
						data: "700"
					},
					{
						name: '强上完————始纺降',
						data: "2.5 S"
					}
				],
				List9: [{
						name: '中停减速时间',
						data: "4.0 S"
					},
					{
						name: '中停后加速时间',
						data: "5.0 S"
					},
					{
						name: '中停完下纲领板的速度',
						data: "340 mm/min"
					},
					{
						name: '中停完下纲领板的距离',
						data: "0.0 mm"
					},
					{
						name: '中停补偿量',
						data: "0.0 mm"
					},
					{
						name: '中停后风机开——纲领板动',
						data: "8.00 S"
					},
				],
				List10: [{
						name: 'A班当班运行时间',
						data: "7 Hour",
						value: '40 Minute'
					},
					{
						name: 'A班累计运行时间',
						data: "611 Hour",
						value: '3 Minute'
					},
					{
						name: '总累计运行时间',
						data: "1911 Hour",
						value: '36 Minute'
					},
					{
						name: 'A班当班产量',
						data: "10.296 Hank",
						value: '7924 m'
					},
					{
						name: 'A班累计产量',
						data: "552.448 Hank",
						value: '424965 m'
					},
					{
						name: '总产量累计',
						data: "2687.529 Hank",
						value: '2067336 m'
					},
				],
				tabTitle3: ['产量显示'], //成产管理导航栏格式
				currentTab3: 0, //sweiper所在页

				tabTitle4: ['异常锭'], // 断纱检测
				currentTab4: 0,


				tabTitleSon: ['当前报警一', '弹窗报警', '铲纱', '清零', '吹吸', '历史报警'], // 机器状态
				tabTitleSon2: ['主机参数一', '主机参数二'], // 参数设置 ————主控参数
				tabTitleSon3: ['基本参数一'], // 参数设置————卷绕参数
				tabTitleSon4: ['A班', 'B班', 'C班', 'D班'], // 生产管理————产量显示
				tabTitleSon5: ['左侧状态一', '左侧状态二', '右侧状态一', '右侧状态二'], // 生产管理————产量显示
				currentTabSon: 0, // 机器状态
				currentTabSon2: 0, // 参数设置 ————主控参数
				currentTabSon3: 0, // 参数设置————卷绕参数
				currentTabSon4: 0, // 生产管理————产量显示
				currentTabSon5: 0, // 断纱检测 ————单锭状态
				btnList: [{
						bgColor: "#16C2C2",
						//名称
						text: "机器状态",
						//转态
						active: "选中",
						//字体颜色
						color: "#fff"
					}, {
						bgColor: "#64B532",
						//名称
						text: "参数设置",
						//字体颜色
						color: "#fff"
					}, {
						bgColor: "#FFA000",
						//名称
						text: "生产管理",
						//字体颜色
						color: "#fff"
					},
					{
						bgColor: "#FF0000",
						//名称
						text: "断纱检测",
						//字体颜色
						color: "#fff"
					}
				],


			}
		},
		components: {
			ScrollDome,
			navTab,
			navTabSon,
			tTable,
			tTh,
			tTr,
			tTd,
			tuiFab
		},
		computed: {
			...mapGetters(['Style', 'Font', 'BackGround', 'BackGroundBox']),
			height() {
				return this.screenHeight - uni.upx2px(this.CustomBar) - uni.upx2px(490)
			},
			heightSon() {
				return this.screenHeight - uni.upx2px(this.CustomBar) - uni.upx2px(560)
			},
		},
		onLoad(option) {
			this.name = option.name
			this.connectSocketInit()
			let IP = uni.getStorageSync('IP');
			let PORT = uni.getStorageSync('PORT');

		},
		onUnload() {
			clearInterval(Interval)
		},
		beforeDestroy() {
			this.closeSocket();
		},
		methods: {
			// 进入这个页面的时候创建websocket连接【整个页面随时使用】
			connectSocketInit() {
				// 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
				this.socketTask = uni.connectSocket({
					// 【非常重要】必须确保你的服务器是成功的,如果是手机测试千万别使用ws://127.0.0.1:9099【特别容易犯的错误】
					url: "ws://" + uni.getStorageSync('IP').split("//")[1] + ':8888/' +
						"/machine",
					// url: "ws://" + uni.getStorageSync('IP').split("//")[1] + ':' + uni.getStorageSync('PORT') +
					// 	"/websocket/socketServer.do",
					success(data) {
						console.log("websocket连接成功");
					},
				});
				let data = {
					"machine": 'XS'
					// "procedure": "细纱",
					// "machine": this.Vlod,
					// "type": 0
				}
				// let data = {
				// 	"url": "XS_minuteInfo",
				// 	"data": {}
				// }
				this.socketTask.onOpen((res) => {
					console.log("WebSocket连接正常打开中...！");
					// 注：只有连接正常打开中 ，才能正常成功发送消息
					// setInterval(()=> {
					this.socketTask.send({
						data: JSON.stringify(data),
						async success() {
							console.log("消息发送成功");
						},
					});
					// },1000)
					// 注：只有连接正常打开中 ，才能正常收到消息
					this.socketTask.onMessage((res) => {
						console.log(JSON.parse(res.data))
						let mydata = JSON.parse(res.data)
						this.tableList = mydata[this.name]
					});
				})
				// 这里仅是事件监听【如果socket关闭了会执行】
				this.socketTask.onClose(() => {
					console.log("已经被关闭了")
				})
			},
			// 关闭websocket【离开这个页面的时候执行关闭】
			closeSocket() {
				this.socketTask.close({
					success(res) {
						console.log("关闭成功", res)
					},
					fail(err) {
						console.log("关闭失败", err)
					}
				})
			},
			//机器状态
			changeTab(index) {
				console.log(index);
				this.currentTab = index
			},
			//参数设置
			changeTab2(index) {
				this.currentTab2 = index
			},
			//生产管理
			changeTab3(index) {
				this.currentTab3 = index
			},
			//断纱检测
			changeTab4(index) {
				this.currentTab4 = index
			},
			changeTabSon(index) {
				this.currentTabSon = index
			},
			changeTabSon2(index) {
				this.currentTabSon2 = index
			},
			changeTabSon3(index) {
				this.currentTabSon3 = index
			},
			changeTabSon4(index) {
				this.currentTabSon4 = index
			},
			changeTabSon5(index) {
				this.currentTabSon5 = index
			},
			change(e) {
				console.log(e.detail);
			},
			//浮动按钮点击事件
			onClick(e) {
				console.log(e.index);
				this.page = e.index
				console.log(e.index == this.page);
				switch (e.index) {
					case 0:
						this.$refs.navTab.getSystemInfo(2)
						break;
					case 1:
						this.$refs.navTab.getSystemInfo(2)
						break;
					case 2:
						this.$refs.navTab.getSystemInfo(1)
						break;
					case 3:
						this.$refs.navTab.getSystemInfo(1)
						break;
					default:
						break;
				}
			},
			// swiper 滑动 机器状态
			swiperTab(e) {
				var index = e.detail.current //获取索引
				console.log(index);
				if (this.tabTitle.length <= 5) {
					this.$refs.navTab.navClick(index)
				} else {
					this.$refs.navTab.longClick(index)
				}
			},
			// swiper 滑动 参数设置
			swiperTab2(e) {
				var index = e.detail.current //获取索引
				console.log(index);
				if (this.tabTitle2.length <= 5) {
					this.$refs.navTab.navClick(index)
				} else {
					this.$refs.navTab.longClick(index)
				}
			},
			// swiper 滑动 生产管理
			swiperTab3(e) {
				var index = e.detail.current //获取索引
				console.log(index);
				if (this.tabTitle3.length <= 5) {
					this.$refs.navTab.navClick(index)
				} else {
					this.$refs.navTab.longClick(index)
				}
			},
			// swiper 滑动 断纱检测
			swiperTab4(e) {
				var index = e.detail.current //获取索引
				console.log(index);
				if (this.tabTitle4.length <= 5) {
					this.$refs.navTab.navClick(index)
				} else {
					this.$refs.navTab.longClick(index)
				}
			},
			// swiper 滑动
			swiperTabSon(e) {
				var index = e.detail.current //获取索引
				console.log(index);
				if (this.tabTitleSon.length <= 5) {
					this.$refs.navTabSon[0].navClickSon(index)
				} else {
					this.$refs.navTabSon[0].longClickSon(index)
				}
			},
			// swiper 滑动
			swiperTabSon2(e) {
				var index = e.detail.current //获取索引
				console.log(index);
				if (this.tabTitleSon2.length <= 5) {
					this.$refs.navTabSon2[0].navClickSon(index)
				} else {
					this.$refs.navTabSon2[0].longClickSon(index)
				}
			},
			// swiper 滑动
			swiperTabSon3(e) {
				var index = e.detail.current //获取索引
				console.log(index);
				if (this.tabTitleSon3.length <= 5) {
					this.$refs.navTabSon3[0].navClickSon(index)
				} else {
					this.$refs.navTabSon3[0].longClickSon(index)
				}
			},
			// swiper 滑动
			swiperTabSon4(e) {
				var index = e.detail.current //获取索引
				console.log(index);
				if (this.tabTitleSon4.length <= 5) {
					this.$refs.navTabSon4[0].navClickSon(index)
				} else {
					this.$refs.navTabSon4[0].longClickSon(index)
				}
			},
			// swiper 滑动
			swiperTabSon5(e) {
				var index = e.detail.current //获取索引
				console.log(index);
				if (this.tabTitleSon5.length <= 5) {
					this.$refs.navTabSon5[0].navClickSon(index)
				} else {
					this.$refs.navTabSon5[0].longClickSon(index)
				}
			},
			//监听用户下拉事件
			onPullDownRefresh() {
				setTimeout(function() {
					uni.stopPullDownRefresh();
				}, 500);
			},
			getServerData() {

			},
			touchColumn(e) {
				canvaColumn.showToolTip(e, {
					format: function(item, category) {
						if (typeof item.data === 'object') {
							return category + ' ' + item.name + ':' + item.data.value
						} else {
							return category + ' ' + item.name + ':' + item.data
						}
					}
				});
				canvaColumn.touchLegend(e, {
					animation: true
				});
			},
		}
	}
</script>

<style lang="scss">
	.fixedtwo {
		position: fixed;
		display: flex;
		left: 0px;
		width: 100%;
	}

	.swiper {
		position: fixed;
		width: 100%;
		left: 0px;
	}

	.Lifting1,
	.Lifting2,
	.Lifting3 {
		position: absolute;
		color: rgb(127, 184, 178);
		font-size: 25px;
	}

	.Lifting1 {
		bottom: 27px;
		left: 210rpx;
	}

	.Lifting2 {
		bottom: 40px;
		left: 410rpx;
	}

	.Lifting3 {
		bottom: 40px;
		left: 617rpx;
	}
</style>
